<?php

define('IN_DOUCO', true);
// 强制在移动端中显示PC版
/*
if (isset($_REQUEST['mobile'])) {
    setcookie('client', 'pc');
    if (isset($_COOKIE['client']) && $_COOKIE['client'] != 'pc') $_COOKIE['client'] = 'pc';
}
require (dirname(__FILE__) . '/include/init.php');
*/
session_start();
define('ROOT_PATH', __DIR__.'/../');
// define('TPL_DIR', 'http://orof62yqt.bkt.clouddn.com/tpl/');
define('TPL_DIR', __DIR__.'/tpl/');
define('CTL_DIR', __DIR__.'/ctl/');

define('TPL_PATH', 'tpl/');

require_once ROOT_PATH.'data/config.php';
require_once ROOT_PATH.'data/common.php';
require_once ROOT_PATH.'include/mysql.class.php';
require_once ROOT_PATH.'include/cache.class.php';
//dou 核心文件
require_once ROOT_PATH.'include/common.class.php';
require_once ROOT_PATH.'include/action.class.php';
$dou = new Action($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dbcharset);
//语言包
require_once ROOT_PATH.'languages/zh_cn/common.lang.php';

$c    = empty($_REQUEST['c']) ? 'index' : $_REQUEST['c'];
$a    = empty($_REQUEST['a']) ? 'index' : $_REQUEST['a'];
$tpl  = empty($_REQUEST['t']) ? 'index' : trim($_REQUEST['t']);
$page = empty($_REQUEST['p']) ? '1' : trim($_REQUEST['p']);

if(file_exists(CTL_DIR."$c.php")){
	$db = new DbMysql($dbhost, $dbuser, $dbpass, $dbname, $prefix, $dbcharset);
	if(!$db) die('Error: Can not connect to mysql server');
	$cache = new cache(array('cacheDir'=>ROOT_PATH.'/cache'));
	//require_once CTL_DIR."inc.func.php";
	require_once CTL_DIR."$c.php";
}

//include_once TPL_DIR.$tpl.'.html';



?>